{template 'header'}
<ul class="nav nav-tabs">
    <li class="active"><a href="javascript:;">奖品管理</a></li>
</ul>
<form action="" method="post" class="form-horizontal" id="myform" role="form" enctype="multipart/form-data">

      <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">奖品类型</label>
        <div class="col-sm-9 col-xs-12">
            <label class="radio-inline">
                <input type="radio" name="type" value="1" {if $luck['type'] == 1 || $luck['type'] == ''} checked {/if} /> 实物
            </label>
            <label class="radio-inline">
                <input type="radio" name="type" value="3" {if $luck['type'] == 2} checked {/if}/>红包
            </label>

        </div>
    </div>

    <div id="red" {if $luck['type'] != 2} style="display: none"{/if}>
        <div class="form-group" >
            <label class="col-xs-12 col-sm-3 col-md-1 control-label">红包类型</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name="red_type" value="1" {if $luck['red_type'] == 1 || $luck['type'] == ''} checked {/if} /> 固定金额
                </label>
                <label class="radio-inline">
                    <input type="radio" name="red_type" value="2" {if $luck['red_type'] == 2} checked {/if}/>随机红包
                </label>

            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-1 control-label">红包金额:</label>
            <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
                <input class="form-control" name="red_money" placeholder="红包金额" value="{$luck['red_money']}" type="text">
            </div>
        </div>

    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">奖品名称:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" name="name" placeholder="奖品名称" value="{$luck['name']}" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">奖品数量:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            <input class="form-control" name="number" placeholder="奖品数量" value="{$luck['number']}" type="text">
        </div>
    </div>
    <div class="form-group" id="ling-1">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label">奖品图片:</label>
        <div class="col-sm-7 col-lg-8 col-md-8 col-xs-12">
            {php echo tpl_form_field_image('cover_image',  $luck['cover_image'],  tomedia($luck['cover_image']));}
            <small style="color: red">图片大小建议为 : 60 * 60 正方形即可</small>
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-1 control-label"></label>
        <div class="" >
            <input type="hidden" name="op" value="add">
            <input type="hidden" name="luck_id" value="{$luck_id}">
            <input type="submit" name="submit" id="submit" value="添加" class="btn btn-primary">
        </div>
    </div>
</form>
{template 'footer'}
<script>
    $(function () {
        $("input[name='type']").click(function () {
            if ( $(this).val() ==3 ) {
                $('#red').show();
            } else {
                $('#red').hide();
            }
        });
    })
</script>